﻿using Google.Apis.Auth.OAuth2;
using Google.Apis.Auth.OAuth2.Flows;
using Google.Apis.Auth.OAuth2.Mvc;
using Google.Apis.Auth.OAuth2.Requests;
using Google.Apis.Auth.OAuth2.Responses;
using Google.Apis.Auth.OAuth2.Web;
using Google.Apis.Drive.v2;
using Google.Apis.Drive.v2.Data;
using Google.Apis.Services;
using Google.Apis.Util.Store;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace CloudStorageLight.Core
{
    internal class AppAuthorizationCodeWebApp : AuthorizationCodeWebApp
    {
        private readonly FlowMetadata flowData;

        private string userId;

        public AppAuthorizationCodeWebApp(string userId, FlowMetadata flowData, string callbackUrl, string rerturnUrl)
            : base(flowData.Flow, callbackUrl, rerturnUrl)
        {
            this.flowData = flowData;
            this.userId = userId;
        }

        public Task<AuthorizationCodeWebApp.AuthResult> AuthorizeAsync(CancellationToken taskCancellationToken)
        {
            return base.AuthorizeAsync(userId, taskCancellationToken);
        }

        public FlowMetadata FlowData
        {
            get
            {
                return this.flowData;
            }
        }
    }

}
